import request from '@/utils/request'

export function getGatewayAccountByPage(query) {
  return request({
    url: '/mall/api/system/gateway-account',
    method: 'get',
    params: query
  })
}

export function addGatewayAccount(data) {
  return request({
    url: '/mall/api/system/gateway-account',
    method: 'post',
    data
  })
}

export function getGatewayAccountById(id) {
  return request({
    url: '/mall/api/system/gateway-account/' + id,
    method: 'get'
  })
}

export function putGatewayAccountById(id, data) {
  return request({
    url: '/mall/api/system/gateway-account/' + id,
    method: 'put',
    data
  })
}

export function deleteGatewayAccountById(id) {
  return request({
    url: '/mall/api/system/gateway-account/' + id,
    method: 'delete'
  })
}

export function getDataDictByPage(query) {
  return request({
    url: '/mall/api/system/data-dict',
    method: 'get',
    params: query
  })
}

export function addDataDict(data) {
  return request({
    url: '/mall/api/system/data-dict',
    method: 'post',
    data
  })
}

export function getDataDictById(id) {
  return request({
    url: '/mall/api/system/data-dict/' + id,
    method: 'get'
  })
}

export function putDataDictById(id, data) {
  return request({
    url: '/mall/api/system/data-dict/' + id,
    method: 'put',
    data
  })
}

export function deleteDataDictById(id) {
  return request({
    url: '/mall/api/system/data-dict/' + id,
    method: 'delete'
  })
}

export function fetchDataDicts(data) {
  return request({
    url: '/mall/api/system/data-dict/fetch',
    method: 'post',
    data
  })
}

export function getGatewayAccountInfo() {
  return request({
    url: '/mall/api/system/gateway-account/info',
    method: 'get'
  })
}

export function updatePassword(data) {
  return request({
    url: '/mall/api/system/gateway-account/update-password',
    method: 'post',
    params: data
  })
}

export function fetchEnum(data) {
  return request({
    url: '/mall/api/system/fetch-enum',
    method: 'post',
    data
  })
}

export function getEnumBrand() {
  return request({
    url: '/mall/api/system/enum/brand',
    method: 'get'
  })
}

export function getEnumDeliveryType() {
  return request({
    url: '/mall/api/system/enum/delivery-type',
    method: 'get'
  })
}

export function getEnumSupplierChannel() {
  return request({
    url: '/mall/api/system/enum/supplier-channel',
    method: 'get'
  })
}
